package 设计模式.i_装饰模式;

/**
 * 糖
 * 
 * @author caihe
 * @date 2023/3/13 10:55
 */
public class Sugar extends CondimentDecorator {

    // 给drink加糖
    public Sugar(Drink drink) {
        super(drink);
    }

    @Override
    public Double needCost() {
        // 糖需要加1.5元
        return drink.needCost() + 1.5;
    }

    @Override
    public String printDesc() {
        return drink.printDesc() + " + 糖";
    }
    
}
